//
//  JMEdietrCell.m
//  JMTest
//
//  Created by JM on 15-4-17.
//  Copyright (c) 2015年 admin. All rights reserved.
//

#import "JMEdietrCell.h"

@implementation JMEdietrCell

+ (NSString *)ID
{
    NSAssert(0, @"禁止使用");
    return @"JMEdietrCell";
}

+ (instancetype)editerCell
{
    NSArray* nibs = [[NSBundle mainBundle] loadNibNamed:@"JMEdietrCell" owner:nil options:nil];
    return [nibs firstObject];
}

- (NSInteger)height {
    return self.frame.size.height;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [self.rightEditer resignFirstResponder];
    return YES;
}
- (NSString *)valueData{
    return self.rightEditer.text;
}
+ (instancetype)cell {
    return [JMEdietrCell editerCell];
}

+ (JMEdietrCell *) cellWithLabelText:(NSString *)aText keyboardType:(UIKeyboardType) aType placeholder:(NSString *)aPlaceHolderText {
    JMEdietrCell *cell = [JMEdietrCell editerCell];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.leftLabel.text = aText;
    cell.leftLabel.adjustsFontSizeToFitWidth = YES;
    cell.rightEditer.keyboardType = aType;
    cell.rightEditer.placeholder = aPlaceHolderText;
    return cell;
}
@end
